package com.springboot.cloud.system.controller;

import com.springboot.cloud.core.annotation.SystemLog;
import com.springboot.cloud.core.utils.Result;
import com.springboot.cloud.system.service.SystemUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>  </p>
 *
 * @author Bertram
 * @since 11/5/2019 11:16 AM
 */
@RestController
@RequestMapping("/system_user")
@Slf4j
public class SystemUserController {

    private SystemUserService systemUserService;

    public SystemUserController(SystemUserService systemUserService) {
        this.systemUserService = systemUserService;
    }

    @SystemLog(serviceId = "system-service", moduleName = "service-system", actionName = "获取用户根据id")
    @GetMapping("/get_user")
    public Result query(@RequestParam String uniqueId) {
        log.debug("query with username or mobile:{}", uniqueId);
        return Result.success(systemUserService.getByUniqueId(uniqueId));
    }
}
